package org.test.web;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.test.service.ServiceOne;

/**
 * 使用spring mvc 需要 注意的地方
 * 1.格式化显示
 * 2.国际化
 * 3.权限验证
 * 4.表单标签
 * 5.
 * 
 * @author Guodeqi
 * 
 */

@Controller
public class IndexController {
	public static final int DEFAULT_PER_PAGE = 25;
	
	private ServiceOne service = null;
	
	public IndexController(){
	}
	
	@Autowired
	public IndexController(ServiceOne service){
		this.service = service;
	}
	
	@RequestMapping({"/","/index"})
	public String showIndexPage(Map<String , Object> model){
		
		model.put("valOne", service.doSomeThing(DEFAULT_PER_PAGE));
		
		return "index2";
	}
}
